package com.example.mybaiduweishi.fragments;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.mybaiduweishi.R;
import com.example.mybaiduweishi.fragments.base.BaseFragmentbase;
import com.example.mybaiduweishi.utils.MyUtil;
import com.example.mybaiduweishi.vo.Contacts;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * Created by Administrator on 2017/6/5 0005.
 */

public class ShowContactsFragment extends BaseFragmentbase {
    private List<Contacts> list;
    private MyContactsAdapter adapter;

    @Override
    public int getXML() {
        return R.layout.show_all_fragment;
    }

    @Override
    public void initView() {

    }

    @Override
    public void initData() {
        //1、得到数据
       list = MyUtil.getAllContacts();
    }

    class MyContactsAdapter extends RecyclerView.Adapter<MyContactsAdapter.MyViewHolder>{


        @Override
        public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            return null;
        }

        @Override
        public void onBindViewHolder(MyViewHolder holder, int position) {

        }

        @Override
        public int getItemCount() {
            return 0;
        }

        class MyViewHolder extends RecyclerView.ViewHolder {
            TextView tel;
            TextView address;
            public MyViewHolder(View itemView) {
                super(itemView);
                tel = (TextView) itemView.findViewById(R.id.text_contacts_tel);
                address = (TextView) itemView.findViewById(R.id.text_contacts_address);
            }
        }
    }


//    class MyRecycleViewAdapter extends RecyclerView.Adapter<MyRecycleViewAdapter.MyViewHolder>{
//        private List<Contacts> datas;
//        private Context context;
//        private LayoutInflater layoutInflater;
//
//
//        public MyRecycleViewAdapter (Context context,List<Contacts> datas){
//            this.context = context;
//            this.datas = datas;
//            layoutInflater = LayoutInflater.from(context);
//        }
//        @Override
//        public MyRecycleViewAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//            View view = layoutInflater.inflate(R.layout.item_address,parent,false);
//            MyViewHolder holder = new MyViewHolder(view);
//            return holder;
//
//        }
//
//        @Override
//        public void onBindViewHolder(MyRecycleViewAdapter.MyViewHolder holder,final int position) {
//            holder.tel.setText(position);
////            holder.address.setText(AddressDao.queryAdress(,this));
//        }
//
//        @Override
//        public int getItemCount() {
//            return datas.size();
//        }
//        class MyViewHolder extends RecyclerView.ViewHolder {
//            TextView tel;
//            TextView address;
//            public MyViewHolder(View itemView) {
//                super(itemView);
//                tel = (TextView) itemView.findViewById(R.id.text_contacts_tel);
//                address = (TextView) itemView.findViewById(R.id.text_contacts_address);
//            }
//        }
//    }
}
